package cn.mldn.microboot.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;


/**
 * description:
 * Created by gy on 2017/8/15.
 */
@Configuration
public class UploadConfig {

    @Bean
    public MultipartConfigElement getMultipartConfig(){
        MultipartConfigFactory multipartConfigFactory = new MultipartConfigFactory();
        multipartConfigFactory.setMaxFileSize("10MB");
        multipartConfigFactory.setMaxRequestSize("100MB");
        return multipartConfigFactory.createMultipartConfig();
    }
}
